Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controllers): engine.beginTimer(ms, string) would evaluate the code immediately instead of after ms #11953

Merged
merged 4 commits into from
Sep 9, 2023

Conversation

Swiftb0y
Copy link
Member

@Swiftb0y Swiftb0y commented Sep 9, 2023

From what I can tell, this must've been broken for years in 2.4 (075664d to be exact)...
The resulting behavior until now was that the string was evaluated immediately instead of after the timeout and when the timer was recurring, it was never evaluated after (since the stored result value was likely not callable).

The first commit fixes the mapping, the second commit fixes the API call, the third commit is some refactoring required for the fourth commit which will cause a logOrThrowError when the callback was not callable.

Previosly, the string would be evaluated immediately instead of
after the timer. this also caused issues when beginTimer was
used recursively.
…ScriptEngineBase::executeFunction is not callable
@Swiftb0y Swiftb0y added this to the 2.4.0 milestone Sep 9, 2023
@Swiftb0y
Copy link
Member Author

Swiftb0y commented Sep 9, 2023

fyi the pre-commit issue is from eslint because I touched a legacy mapping. Lets just ignore the eslint failure.

@daschuer
Copy link
Member

daschuer commented Sep 9, 2023

This aims to fix #11932 Let's wait for @todx0 for confirmation.

@Swiftb0y
Copy link
Member Author

Swiftb0y commented Sep 9, 2023

they already did for the actual fix (second commit). the fourth is just to spot issues like this sooner in the future.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, Than it should be safe to merge.
Thank you for the fix.

@daschuer daschuer merged commit 5ec5ab8 into mixxxdj:2.4 Sep 9, 2023
10 of 11 checks passed
@Swiftb0y
Copy link
Member Author

Thank you.

@Swiftb0y Swiftb0y deleted the fix/gh11932 branch September 10, 2023 10:56
geraldog added a commit to geraldog/mixxx that referenced this pull request Oct 1, 2023
form to align with merged PR mixxxdj#11953 "fix(controllers):
engine.beginTimer(ms, string) would evaluate the code
immediately instead of after ms"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants